package com.kuaidi100.sdk.response;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * @Author: api.kuaidi100.com
 * @Date: 2020-07-14 16:14
 */
public class QueryTrackRouteInfo {
    /**
     * 出发位置
     */
    private QueryTrackPosition from;
    /**
     * 当前位置
     */
    private QueryTrackPosition cur;
    /**
     * 收货地
     */
    private QueryTrackPosition to;

    @Override
    public String toString() {
        try {
            ObjectMapper objectMapper = new ObjectMapper();
            return objectMapper.writeValueAsString(this);
        } catch (Exception e) {
            return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                    .append("from", from)
                    .append("cur", cur)
                    .append("to", to)
                    .toString();
        }
    }

    public QueryTrackPosition getFrom() {
        return from;
    }

    public void setFrom(QueryTrackPosition from) {
        this.from = from;
    }

    public QueryTrackPosition getCur() {
        return cur;
    }

    public void setCur(QueryTrackPosition cur) {
        this.cur = cur;
    }

    public QueryTrackPosition getTo() {
        return to;
    }

    public void setTo(QueryTrackPosition to) {
        this.to = to;
    }
}
